//
//  TopBarViewController.m
//  auditorias
//
//  Created by Mauro Andres Carreño on 10/22/13.
//  Copyright (c) 2013 Antilope. All rights reserved.
//

#import "TopBarViewController.h"
#import "SharedMemory.h"
#import "AppDelegate.h"

@interface TopBarViewController ()

@end

@implementation TopBarViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

+ (void) setTitleLabelOf:(UIView*)topbar text:(NSString*)text
{
    UILabel* topBarLabel = (UILabel*)[topbar viewWithTag:770];
    [topBarLabel setText:text];
}


- (IBAction)logout:(id)sender
{
    SharedMemory* mem = [SharedMemory sharedInstance];
    [mem.users removeAllObjects];
    [self.parentViewController.parentViewController.navigationController popToRootViewControllerAnimated:YES];
}

@end
